<?php
// ------------------------------------------------------------------------------------
// Bestand:       DBoutput
// Versie:        1.0
// Projekt:       Cursus MasterClass van Eduvision
// Datum:         14-07-2008
// Auteur(s):     Ronald Obbens
// Email(s):      ronaldobbens@gmail.com
// Revisie(s):	 
//
// Beschrijving:  The DBoutput saves the database output in a easy to use object
// ------------------------------------------------------------------------------------
//

class DBoutput
{
	private $m_aData;
	private $m_iRecordId;
	private $m_sMessage;
	
	public function __construct()
	{
		$this->m_aData = array();
		$this->m_iRecordId = null;
		$this->m_sMessage = null;
	}
	
	/**
	 * Set the returned datarow
	 *
	 * @param string $p_sValue
	 */
	public function addData($p_aDatarow)
	{
		$this->m_aData = $p_aDatarow; 
	}
	
	/**
	 * get the returned datarow
	 *
	 * @return string
	 */
	public function getData()
	{		
		return $this->m_aData;
	}
	
	/**
	 * set the recordid of the record in the database
	 *
	 * @param integer $p_iRecordId
	 */
	public function setRecordId($p_iRecordId)
	{
		$this->m_iRecordId = $p_iRecordId;
	}
	
	/**
	 * get the recordid of the record in the database
	 *
	 * @return integer
	 */
	public function getRecordID()
	{
		return $this->m_iRecordId;
	}
	
	/**
	 * Get if set the returned errormessage
	 *
	 * @return string
	 */
	public function getMessage()
	{
		if($this->m_sMessage === null)
		{
			return 'No problemos...';
		}
		
		return $this->m_sMessage;
	}
	
	/**
	 * Set an error message
	 *
	 * @param string $p_sMessage
	 */
	public function setMessage($p_sMessage)
	{
		$this->m_sMessage = $p_sMessage;
	}
}
?>